// Package handler
// @Author zhongxc
// @Date 2023/12/14 15:18:00
// @Desc
package handler

import (
	"github.com/twinj/uuid"
	"github.com/zeromicro/go-zero/core/logx"
	"github.com/zeromicro/go-zero/rest/httpx"
	"golang.org/x/net/context"
	"net/http"
	common "zhongxc.cc/admin-common"
	"zhongxc.cc/admin-user-api/internal/svc"
)

type UploadHandler struct {
	svcCtx *svc.ServiceContext
}

func NewUploadHandler(svcCtx *svc.ServiceContext) *UploadHandler {
	return &UploadHandler{
		svcCtx: svcCtx,
	}
}

func (h *UploadHandler) Upload(w http.ResponseWriter, r *http.Request) {
	logx.Info(r.Header.Get("X-Middleware"))
	httpx.OkJsonCtx(context.Background(), w, common.NewResult().Deal(200, nil))
}

func (h *UploadHandler) GetUuid(w http.ResponseWriter, r *http.Request) {
	id := uuid.NewV4().String()
	httpx.OkJsonCtx(context.Background(), w, common.NewResult().Deal(id, nil))
}
